package com.by;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;


@SpringBootApplication
@EnableWebSecurity  //启动security
public class SpringSecurityApp {
    public static void main(String[] args) {
        //ac 袋子（Map<springSecurityFilterChain, new FilterChainProxy()>）
        ApplicationContext ac = SpringApplication.run(SpringSecurityApp.class, args);
        //从袋子里把springSecurityFilterChain拿出来，通过"springSecurityFilterChain"key值，把对象从袋子里拿出来。
        Object bean = ac.getBean("springSecurityFilterChain");
        //获取类型 FilterChainProxy
        //bean中map值是 new FilterChainProxy():是一个filter过滤器，则会过滤所有请求
        System.out.println(bean.getClass());

        Integer a = 5;
        System.out.println(a.getClass());
    }
}
